﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DataLibrary
{
   public class Ctbl_Faq:IData<tbl_Faq>
    {
       public Ctbl_Faq() { }
       public Ctbl_Faq(String myconnecString) : base(myconnecString) { }

       public override List<tbl_Faq> GetAll(tbl_Faq item)
       {
           throw new NotImplementedException();
       }

       public override tbl_Faq GetItemById(object id)
       {
           return GetAll().SingleOrDefault(p => p.IdFaq == Convert.ToInt32(id));
       }

       public override tbl_Faq GetItem(System.Data.IDataReader dr)
       {
           tbl_Faq obj = new tbl_Faq();
           obj.AddedDate = Convert.ToDateTime(dr[tbl_Faq.c_addedDate]);
           obj.IdFaq = Convert.ToInt32(dr[tbl_Faq.c_idFaq]);
           obj.IsActive = Convert.ToInt32(dr[tbl_Faq.c_isActive]);
           obj.OrderId = Convert.ToInt32(dr[tbl_Faq.c_orderId]);
           return obj;
       }

       public override List<tbl_Faq> GetAll()
       {
           String strSQL = "select * from " + tbl_Faq.b_tbl_Faq + strAsc;
           return GetAll(strSQL, CommandType.Text);
       }

       protected override int InsertOnSubmit(tbl_Faq item, int t)
       {
           throw new NotImplementedException();
       }
    }
}
